cbuffer PerFrame {
  uniform float4x4 LightWVP;
};

struct VSOutputShadow {
  float4 PositionPS : SV_POSITION;
  float Depth : TEXCOORD0;
};

VSOutputShadow VS_Shadow(float3 position : POSITION) {
  VSOutputShadow output;
  output.PositionPS = mul(float4(position, 1.0f), LightWVP);
  output.Depth = (output.PositionPS.z / output.PositionPS.w);
  return output;
}

float4 PS_Shadow(VSOutputShadow input) : SV_TARGET0 {
  return float4(input.Depth, 0, 0, 1.0f);
}

technique10 ShadowMap {
  pass pass0 {
    SetGeometryShader(0);
		SetVertexShader(CompileShader(vs_4_0, VS_Shadow()));
		SetPixelShader(CompileShader(ps_4_0, PS_Shadow()));
  }
}